<template>
	<view style="100%">
		<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000" style="height: 250px;"
			:current="2" @change="swiperChange">
			<swiper-item v-for="item,index in list">
				<view class="swiper-item" style="width: 100%;height: 100%;">
					<image :src="item" mode="" style="width: 100%;height: 100%;"></image>
				</view>
			</swiper-item>
		</swiper>
		<text>功能列表</text>
		<uni-grid :column="5" @change="gridChange">
			<uni-grid-item :index="index" v-for="(item,index) in typelist">
				<view class="grid-item">
					<image :src="'../../static'+item.icon" mode="" style="width: 50px;height: 50px;"></image>
					<text>{{item.typename}}</text>
				</view>
			</uni-grid-item>
		</uni-grid>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				"typelist":[
					{
						"id":1,
						"typename":"新闻",
						"icon":"/images/news.png"
					},
					{
						"id":2,
						"typename":"公告",
						"icon":"/images/announcement.png"
					},
					{
						"id":3,
						"typename":"同学",
						"icon":"/images/classmate.png"
					},
					{
						"id":4,
						"typename":"电话",
						"icon":"/images/telephone.png"
					},
					{
						"id":5,
						"typename":"留言",
						"icon":"/images/leaveword.png"
					},
				],
				"list": [
					'../../static/images/school1.jpg',
					'../../static/images/school2.jpg',
					'../../static/images/school3.jpg',
					'../../static/images/school4.jpg'
				]


			}
		},
		methods: {
			swiperChange(e){
				console.log("===",e)
			},
			gridChange(e){
				console.log("===",e)
			}
		}
	}
</script>

<style>
page{
	height: 100%;
}
.grid-item{
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-items: center;
}
</style>